﻿#pragma once

#include "../../Server/MirEnvir/Envir.h"
#include <string>
#include <any>

using namespace Server::MirDatabase;
using namespace Server::MirEnvir;

namespace Server
{
    class MiningInfoForm : public System::Windows::Forms::Form
    {
    public:
        virtual ~MiningInfoForm()
        {
            delete components;
            delete tabControl1;
            delete tabPage1;
            delete MineRemoveIndexbutton;
            delete MineAddIndexbutton;
            delete MineIndexcomboBox;
            delete label64;
            delete groupBox7;
            delete label79;
            delete MineNametextBox;
            delete MineSlotstextBox;
            delete label70;
            delete label69;
            delete label68;
            delete MineDropRatetextBox;
            delete MineHitRatetextBox;
            delete MineAttemptstextBox;
            delete MineRegenDelaytextBox;
            delete label67;
            delete label66;
            delete label65;
            delete tabPage2;
            delete label78;
            delete MineDropsIndexcomboBox;
            delete groupBox8;
            delete MineMaxBonustextBox;
            delete label77;
            delete MineBonusChancetextBox;
            delete label76;
            delete MineMaxQualitytextBox;
            delete label75;
            delete MineMinQualitytextBox;
            delete label74;
            delete MineMaxSlottextBox;
            delete label73;
            delete MineMinSlottextBox;
            delete label72;
            delete MineItemNametextBox;
            delete label71;
            delete MineRemoveDropbutton;
            delete MineAddDropbutton;
        }

        Server::MirEnvir::Envir *getEnvir() const;

        bool MinesChanged = false;

        MiningInfoForm();

    private:
        void MiningInfoForm_FormClosed(std::any sender, FormClosedEventArgs *e);

        void UpdateMines();


        #pragma region Events

        void MineIndexcomboBox_SelectedIndexChanged(std::any sender, EventArgs *e);

        void MineAddIndexbutton_Click(std::any sender, EventArgs *e);

        void MineRemoveIndexbutton_Click(std::any sender, EventArgs *e);

        void MineRegenDelaytextBox_TextChanged(std::any sender, EventArgs *e);

        void MineAttemptstextBox_TextChanged(std::any sender, EventArgs *e);

        void MineSlotstextBox_TextChanged(std::any sender, EventArgs *e);

        void MineHitRatetextBox_TextChanged(std::any sender, EventArgs *e);

        void MineDropRatetextBox_TextChanged(std::any sender, EventArgs *e);

        void MineDropsIndexcomboBox_SelectedIndexChanged(std::any sender, EventArgs *e);

        void MineAddDropbutton_Click(std::any sender, EventArgs *e);

        void MineRemoveDropbutton_Click(std::any sender, EventArgs *e);

        void MineItemNametextBox_TextChanged(std::any sender, EventArgs *e);

        void MineMinSlottextBox_TextChanged(std::any sender, EventArgs *e);

        void MineMaxSlottextBox_TextChanged(std::any sender, EventArgs *e);

        void MineMinQualitytextBox_TextChanged(std::any sender, EventArgs *e);

        void MineMaxQualitytextBox_TextChanged(std::any sender, EventArgs *e);

        void MineBonusChancetextBox_TextChanged(std::any sender, EventArgs *e);

        void MineMaxBonustextBox_TextChanged(std::any sender, EventArgs *e);

        void MineNametextBox_TextChanged(std::any sender, EventArgs *e);

        #pragma endregion



        /// <summary>
        /// Required designer variable.
        /// </summary>
        System::ComponentModel::IContainer *components = nullptr;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected:
        void Dispose(bool disposing) override;

        #pragma region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
    private:
        void InitializeComponent();

        #pragma endregion

        System::Windows::Forms::TabControl *tabControl1;
        System::Windows::Forms::TabPage *tabPage1;
        System::Windows::Forms::Button *MineRemoveIndexbutton;
        System::Windows::Forms::Button *MineAddIndexbutton;
        System::Windows::Forms::ComboBox *MineIndexcomboBox;
        System::Windows::Forms::Label *label64;
        System::Windows::Forms::GroupBox *groupBox7;
        System::Windows::Forms::Label *label79;
        System::Windows::Forms::TextBox *MineNametextBox;
        System::Windows::Forms::TextBox *MineSlotstextBox;
        System::Windows::Forms::Label *label70;
        System::Windows::Forms::Label *label69;
        System::Windows::Forms::Label *label68;
        System::Windows::Forms::TextBox *MineDropRatetextBox;
        System::Windows::Forms::TextBox *MineHitRatetextBox;
        System::Windows::Forms::TextBox *MineAttemptstextBox;
        System::Windows::Forms::TextBox *MineRegenDelaytextBox;
        System::Windows::Forms::Label *label67;
        System::Windows::Forms::Label *label66;
        System::Windows::Forms::Label *label65;
        System::Windows::Forms::TabPage *tabPage2;
        System::Windows::Forms::Label *label78;
        System::Windows::Forms::ComboBox *MineDropsIndexcomboBox;
        System::Windows::Forms::GroupBox *groupBox8;
        System::Windows::Forms::TextBox *MineMaxBonustextBox;
        System::Windows::Forms::Label *label77;
        System::Windows::Forms::TextBox *MineBonusChancetextBox;
        System::Windows::Forms::Label *label76;
        System::Windows::Forms::TextBox *MineMaxQualitytextBox;
        System::Windows::Forms::Label *label75;
        System::Windows::Forms::TextBox *MineMinQualitytextBox;
        System::Windows::Forms::Label *label74;
        System::Windows::Forms::TextBox *MineMaxSlottextBox;
        System::Windows::Forms::Label *label73;
        System::Windows::Forms::TextBox *MineMinSlottextBox;
        System::Windows::Forms::Label *label72;
        System::Windows::Forms::TextBox *MineItemNametextBox;
        System::Windows::Forms::Label *label71;
        System::Windows::Forms::Button *MineRemoveDropbutton;
        System::Windows::Forms::Button *MineAddDropbutton;
    };
}
